package com.own.center;

import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.own.core.html.form.validateType;
import com.own.core.html.form.dropDown.DropDown;
import com.own.core.html.form.object.ObjectField;
import com.own.core.html.form.textArea.TextArea;
import com.own.core.html.form.textField.TextField;
import com.own.core.object.Dao;
import com.own.core.object.lookup.Gender;

@Entity
@Table(name = "cm_center")
public class Center extends Dao{
	
	private long id;

	@TextField(required = true, linkable ="holes")
	private String name;
	
	@DropDown(property="displayName")
	private Gender gender;

	@TextField(validate = validateType.NUMERIC)
	private String capcity;
	
	@TextArea
	private String address;
	
	@ObjectField
	private Set<Hole> holes;
	
	@Id
	@GeneratedValue(strategy = GenerationType.TABLE)
	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Gender getGender() {
		return gender;
	}

	public void setGender(Gender gender) {
		this.gender = gender;
	}

	public String getCapcity() {
		return capcity;
	}

	public void setCapcity(String capcity) {
		this.capcity = capcity;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}
	@OneToMany(mappedBy = "center")
	public Set<Hole> getHoles() {
		return holes;
	}

	public void setHoles(Set<Hole> holes) {
		this.holes = holes;
	}
}
